<%--
  Created by IntelliJ IDEA.
  User: 86181
  Date: 2022/11/17
  Time: 19:06
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>登记审核</title>
</head>
<body>
        <div style="height:60%;">
            <table id="outboundregistrationexaminetab">

            </table>
        </div>

        <!--出库登记审核-->
        <div class="modal fade"  tabindex="-1" role="dialog" aria-labelledby="gridSystemModalLabel" id="outboundregistrationexaminemodal">
            <div class="modal-dialog modal-lg">
                <div class="modal-content" id="outboundregistrationexaminemdoalson">

                </div>
            </div>
        </div>
        <script>
            //加载数据
            $(function () {
                $("#outboundregistrationexaminetab").bootstrapTable({
                    url:'queryByPaycheckpending.action',
                    method: 'post',                      //请求方式（*）
                    contentType: "application/x-www-form-urlencoded",
                    //toolbar: '#toolbar',              //工具按钮用哪个容器
                    striped: true,                      //是否显示行间隔色
                    cache: false,                       //是否使用缓存，默认为true，所以一般情况下需要设置一下这个属性（*）
                    pagination: true,                   //是否显示分页（*）
                    sortable: true,                     //是否启用排序
                    sortOrder: "asc",                   //排序方式
                    sidePagination: "server",           //分页方式：client客户端分页，server服务端分页（*）
                    pageNumber: 1,                      //初始化加载第一页，默认第一页,并记录
                    pageSize: 5,                     //每页的记录行数（*）
                    pageList: [5,10, 25, 50, 100],        //可供选择的每页的行数（*）
                    search: false,                      //是否显示表格搜索
                    strictSearch: true,
                    showColumns: true,                  //是否显示所有的列（选择显示的列）
                    showRefresh: true,                  //是否显示刷新按钮
                    minimumCountColumns: 2,             //最少允许的列数
                    clickToSelect: true,                //是否启用点击选中行
                    // height: 500,                      //行高，如果没有设置height属性，表格自动根据记录条数觉得表格高度
                    uniqueId: "id",                     //每一行的唯一标识，一般为主键列
                    showToggle: true,                   //是否显示详细视图和列表视图的切换按钮
                    cardView: false,                    //是否显示详细视图
                    detailView: false,
                    queryParams:function (params) {
                        var outboundregistrationexamine={
                            pagesize:params.limit,
                            pageno:(params.offset/params.limit),
                            sort:params.sort,
                            sortOrder:params.sort,
                        }
                        return outboundregistrationexamine;
                    },
                    columns:[
                        {
                            field:"payId",
                            title:"出库单号",
                        },
                        {
                            field:"reason",
                            title:"出库理由",
                            formatter:function (value,row,index) {
                                if (row.reason == "C002-1") {
                                    return "生产领料"
                                }
                                if (row.reason == "C002-2") {
                                    return "赠送"
                                }
                                if (row.reason == "C002-3") {
                                    return "内部借领"
                                }
                                if (row.reason == " C002-4") {
                                    return "其他借领"
                                }
                            }
                        },
                        {
                            field:"reasonexact",
                            title:"出库详情理由",
                        },
                        {
                            field:"registerTime",
                            title:"登记时间",
                        },
                        {
                            field:"amountSum",
                            title:"总件数",
                        },
                        {
                            field:"costPriceSum",
                            title:"总金额(元)",
                        },
                        {
                            field:"",
                            title:"审核",
                            formatter:function (value,row,index) {
                                return "<input type='button' onclick='outboundregisrationexaminebut("+row.payId+")' class='btn btn-primary' value='审核'>"
                            }
                        }
                    ]
                })
            })
            //审核
            function outboundregisrationexaminebut(payId) {
                $("#outboundregistrationexaminemdoalson").load("outboundregistrationexaminemodal.jsp",{"payId":payId})
                $("#outboundregistrationexaminemodal").modal("show")
            }
        </script>
</body>
</html>
